<template>
    <div class="search">

        <mu-appbar :title="title">
            <mu-icon-button @click="$router.back(-1);" icon="navigate_before" slot="left"/>
            <mu-icon-button icon="search" slot="right" :to="{ name :'Search'}" />
        </mu-appbar>

        <div >
            <component :is="showcourse" :courses="ClassifyCourses"></component>
        </div>

    </div>
</template>

<script>

  import CourseList from './CourseList'

  export default {
    name: 'ClassifyCourses',
    created() {
      this.title = this.$route.params.xsm;
      this.$store.dispatch('ClassifyCourses', {yxid:this.$route.params.yxid});
    },
    computed: {
      ClassifyCourses() {
        return this.$store.state.ClassifyCourses;
      }
    },
    data() {
      return {
        title:'搜索',
        showcourse:'list',
      }
    },
    components: {
      list: CourseList
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
    .searbar {
        width: 100%;
        padding: 10px 1rem 0 1rem;
        position: fixed;
        top: 56px;
        left: 0px;
        z-index: 100;
        background: white;
        height: 50px;
        overflow: hidden;;
    }

    .search-btn {
        margin-top: -6px;
        color: #999;
        margin-left: -12px;
    }

    .search-result {
        height: 100%;
        margin-top: 100px;
    }

</style>
